def outer_func(msg):
    a=123
    def inner_func():
        print(f"Hello, {msg}")
        print(f"World",a)
    return inner_func
# closure = outer_func("Python闭包")
# closure()  # 输出：Hello, Python闭包


# 装饰器
def decorator(func):
    def wrapper():
        print("执行前")
        func()
        print("执行后")
    return wrapper

@decorator
def hello():
    print("Hello, World!")


hello()